#pragma once

/*
@author: TriLVH
@description: Factory to create bullet with input type
*/

#include "BulletEntity.h"
#include "GameDeviceSingleton.h"

class BulletFactory {
public:
	static BulletEntity* createBullet(BulletArmies bulletArmy, int type, double x, double y, int direction, Rect* actor, Rect* target, bool isHalf, int distanceForLive) {
		switch (type) {
		default:
			BulletEntity* bullet = new BulletEntity(GameDeviceSingleton::getInstance()->getCurrentEntityId(), type % _ID_BULLET_BOSS_1 == 0 ? _ID_BULLET_BOSS_1 : type, x, y, direction, actor, target, bulletArmy, isHalf, distanceForLive);
			bullet->getAbstractData()->initSpriteHandler(*(GameDeviceSingleton::getInstance()->getSpriteHandler()));
			bullet->getBulletData()->type = type;
			bullet->initData();

			return bullet;
		}
	}
};